<?php
namespace app\admin\controller;

use think\db\exception\DataNotFoundException;
use think\db\exception\ModelNotFoundException;
use think\exception\DbException;

class Test
{
    public function index()
    {
        $data = \app\admin\model\Goods::select();
//        dump($data);die;
/*        foreach ($data as $v) {
            echo $v.'<br>';
        }
        die();*/
//        foreach ($data as &$v) {
//            $v = $v->toArray();
//        }
//        unset($v);
        /*foreach ($data as $k => $v) {
            $data[$k] = $v->toArray();
        }*/

        $data = collection($data)->toArray();
        dump($data);
    }
}
